<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Cipher.pb</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;   PureBasic - Cipher example file
</font><font color="#3A3966">;
</font><font color="#3A3966">;    (c) Fantaisie Software
</font><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;
</font>
<b><font color="#3A3966">CompilerIf</font></b> <font color="#924B72">#PB_Compiler_Unicode</font>
  <b><font color="#3A3966">CompilerError</font></b> "This program should be compiled in ASCII mode (see Compiler/Compiler Option window)"
<b><font color="#3A3966">CompilerEndIf</font></b>

<font color="#3A3966">UseCRC32Fingerprint</font>()
<font color="#3A3966">UseMD5Fingerprint</font>()

<font color="#3A3966">MessageRequester</font>("CRC32 Test", "Should be 352441c2 : "+<font color="#3A3966">StringFingerprint</font>("abc", <font color="#924B72">#PB_Ascii</font>, <font color="#924B72">#PB_Cipher_CRC32</font>), 0)

<font color="#3A3966">MessageRequester</font>("MD5 Test"  , "Should be ed50deb5bb795508b8a5c8e50dafa954 : "+<font color="#3A3966">StringFingerprint</font>("PureBasic", <font color="#924B72">#PB_Ascii</font>, <font color="#924B72">#PB_Cipher_MD5</font>), 0)

<font color="#3A3966">MessageRequester</font>("DES Test"  , "Should be FrfWXJ4yTjycc : "+<font color="#3A3966">DESFingerprint</font>("1Fr", "Fr"), 0)

*OutputBuffer =<font color="#3A3966"> AllocateMemory</font>(100)
<font color="#3A3966">Base64Encoder</font>(@"PureBasic",<font color="#3A3966"> Len</font>("PureBasic"), *OutputBuffer, 100)
<font color="#3A3966">MessageRequester</font>("Base64 Test", "Should be UHVyZUJhc2lj : "+<font color="#3A3966">PeekS</font>(*OutputBuffer), 0)</font></pre>
</body></html>
